package com.lkr.webapp.util;

import java.util.Random;
import java.util.UUID;

/**
 * id工具类
 *
 * @author lss
 * @date 2019-01-21, Mon
 */
public class IdUtils {

    private static Random r = new Random();

    /**
     * 获取32位id
     */
    public static String get32Id() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    /**
     * 获取6位foo id
     */
    public static String getFooId() {
        return get32Id().substring(0, 6).toUpperCase();
    }


    /**
     * 获取6位id
     */
    public static String getUserFooId(String fooId) {
        return fooId + "-" + get32Id().substring(0, 6);
    }

}
